
ENT.Spawnable			= false
ENT.AdminSpawnable		= false

include('shared.lua')

language.Add( "malawar_repulsor", "Repulsor" )


function ENT:Think()
	local down = self.Entity:GetNetworkedInt('DownOnly')
	
	self.RingTimer = self.RingTimer or 0
	if ( self.RingTimer > CurTime() ) then return end
	self.RingTimer = CurTime() + 0.01
	
	local vOffset
	local vNormal
	
	if down == 1 then
		vOffset = self.Entity:GetPos()
		vNormal = (vOffset - Vector(0,0,100000)):GetNormalized()
	else
		vOffset = self.Entity:GetPos() + (self.Entity:GetUp() * self.Entity:OBBMaxs().z)
		vNormal = (vOffset - self.Entity:GetPos()):GetNormalized()
	end
	
	local effectdata = EffectData()
		effectdata:SetOrigin( vOffset )
		effectdata:SetNormal( vNormal )
	util.Effect( "thruster_ring", effectdata )	
	
end